import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';

import '../../../public.dart';

class CommentUtil {
  // 弹出发布输入框
  static void showInput(
      BuildContext context, Widget Function(BuildContext) builder) {
    showMaterialModalBottomSheet(
        barrierColor: Colors.transparent,
        backgroundColor: ColorUtil.rgba(27, 27, 38, 1),
        duration: Duration(milliseconds: 0),
        enableDrag: false,
        context: context,
        builder: builder);
  }

  // 评论和评论回复公共底部输入框占位UI
  static Widget buildInput({String placeholder, Function onTap}) {
    return Container(
      padding: EdgeInsets.only(left: 16, right: 16, top: 10, bottom: 8),
      decoration: BoxDecoration(
          border: Border(top: BorderSide(color: Colors.black, width: 1))),
      margin: EdgeInsets.only(top: 16),
      child: GestureDetector(
          onTap: () {
            onTap();
          },
          child: Row(children: [
            Container(
              width: 320,
              height: 40,
              margin: EdgeInsets.only(right: 6),
              padding: EdgeInsets.only(left: 16, top: 10),
              decoration: BoxDecoration(
                  color: ColorUtil.rgba(40, 40, 56, 1),
                  borderRadius: BorderRadius.all(Radius.circular(16))),
              child: Text(
                placeholder,
                style: TextStyle(color: ColorUtil.rgba(255, 255, 255, 0.3)),
              ),
            ),
            Text('发送', style: TextStyle(color: Colors.white))
          ])),
    );
  }
}
